package org.itworks.biodev.model;

import java.sql.*;
import java.util.Vector;

public class Meeting {
	private Integer id;
	private Timestamp dateTime;
	private Customer hoster = null;
	private int hosterId;
	private Vector <Sale> sales = null;

	
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public Timestamp getDateTime() {
		return dateTime;
	}
	
	public void setDateTime(Timestamp dateTime) {
		this.dateTime = dateTime;
	}

	public Vector<Sale> getSales() {
		return sales;
	}
	
	public float getTotalAmount() {
		float total_amount=0;
		return total_amount;
	}
	
	public Integer getNumberOfSales() {
		Integer numberofsales=0;
		return numberofsales;
	}
	
	public void setHoster(Customer c) {
		this.hoster = c;
		this.hosterId = c.getId();
	}
	
	public Customer getHoster() throws Exception {
		if(this.hoster == null) {
			this.hoster = MeetingTable.getInstance().findHoster(this);
		}
		return this.hoster;
	}
	
	public int getHosterId() {
		return this.hosterId;
	}
	
	public void setHosterId(int hosterId) {
		this.hosterId = hosterId;
	}
	
	public boolean isAfterCurrentDate() {
		java.util.Date currentDate = new java.util.Date();
		return this.dateTime.after(new Timestamp(currentDate.getTime()));
	}

}
